home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 44 / Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso / -in_the_mag- / basics / amos / fselext.lha / FSel_Extension.AMOS / FSel_Extension.amosSourceCode
AMOS Source Code  |  1994-07-28  |  2KB  |  62 lines

  1. ' ---------------------------------------------------------------------------  
  2. '                               FSel Extension       
  3. '                               ~~~~~~~~~~~~~~ 
  4. '               ï¿½ Copyright 1994, Phantom Software Productions   
  5. '                           Programming by Greg Cox      
  6. ' ---------------------------------------------------------------------------  
  7. ' Example: 
  8. ' ~~~~~~~~ 
  9.            Screen Open 0,640,256,2,Hires
  10.            Curs Off : Cls 0
  11.            F$=Fsel$("*.*","","FSel Extension Demo","Select a File")
  12.            If F$="" Then Edit 
  13.            FSEL_DEVICE[F$]
  14.            Print "You have selected:"
  15.            Print : Print "DEVICE   = ";Param$
  16.            FSEL_FILENAME[F$]
  17.            Print "FILENAME = ";Param$
  18.            FSEL_DRAWER[F$]
  19.            Print "LOCATION = ";Param$
  20.            FSEL_FILESIZE[F$]
  21.            Print "BYTES    = ";Param$
  22.            Print : Print "< Press Any Key >"
  23.            Wait Key 
  24.            Screen Close 0
  25.            Edit 
  26. ' ---------------------------------------------------------------------------  
  27. Procedure FSEL_DEVICE[F$]
  28. Shared DEVICE$
  29. M=Instr(F$,":")
  30. DEVICE$=Left$(F$,M)
  31. End Proc[DEVICE$]
  32. Procedure FSEL_FILENAME[F$]
  33. Shared FILENAME$
  34. M=Instr(F$,":")
  35. FILENAME$=Mid$(F$,M+1)
  36. M=Instr(FILENAME$,"/")
  37. If M=0 Then Goto _END
  38. _NEXT:
  39. M1$=Mid$(FILENAME$,M+1)
  40. M=Instr(M1$,"/")
  41. If M=0 Then FILENAME$=M1$ : Goto _END
  42. FILENAME$=M1$
  43. Goto _NEXT
  44. _END:
  45. End Proc[FILENAME$]
  46. Procedure FSEL_FILESIZE[F$]
  47. Open In 1,F$
  48. B=Lof(1)
  49. Close 1
  50. B$=Str$(B)
  51. L=Instr(B$," ")
  52. L1$=Mid$(B$,L+1)
  53. End Proc[L1$]
  54. Procedure FSEL_DRAWER[F$]
  55. Shared FILENAME$,DEVICE$
  56. M=Instr(F$,":")
  57. M$=Mid$(F$,M+1)
  58. M=Instr(M$,"/")
  59. If M=0 Then M1$=DEVICE$ : Goto _END
  60. M1$=DEVICE$+Left$(M$,Len(M$)-Len(FILENAME$))
  61. _END:
  62. End Proc[M1$]